/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package abricots.entity;

import abricots.entity.collision.ServerEntityCollisionManager;
import abricots.entity.command.BasicEntityCommandManager;
import abricots.entity.drawer.ServerEntityDrawer;
import abricots.entity.simulator.ServerEntitySimulator;
import abricots.entity.state.BasicEntityStateManager;
import abricots.game.GameConstants;
import abricots.game.GameEnv;

/**
 *
 * @author charly
 */
public class ServerEntity extends BasicEntity {
   public ServerEntity() {
      simulator = new ServerEntitySimulator(this);
      commandManager = new BasicEntityCommandManager(this);
      stateManager = new BasicEntityStateManager(this);
      collisionManager = new ServerEntityCollisionManager(this);
      drawer = new ServerEntityDrawer(this);
      entityTypeId = GameConstants.ENTITY_TYPE_ID_SERVER;
   }

   @Override
   public void register(GameEnv env) {
      this.env = env;
      env.getEntitiesManager().addEntity(this);
   }

   @Override
   public void unregister() {
      env.getEntitiesManager().removeEntity(id);
   }
}
